home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / include / libpurple / server.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-04  |  5.4 KB  |  137 lines

  1. /**
  2.  * @file server.h Server API
  3.  * @ingroup core
  4.  *
  5.  * purple
  6.  *
  7.  * Purple is the legal property of its developers, whose names are too numerous
  8.  * to list here.  Please refer to the COPYRIGHT file distributed with this
  9.  * source distribution.
  10.  *
  11.  * This program is free software; you can redistribute it and/or modify
  12.  * it under the terms of the GNU General Public License as published by
  13.  * the Free Software Foundation; either version 2 of the License, or
  14.  * (at your option) any later version.
  15.  *
  16.  * This program is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  * GNU General Public License for more details.
  20.  *
  21.  * You should have received a copy of the GNU General Public License
  22.  * along with this program; if not, write to the Free Software
  23.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  24.  */
  25. #ifndef _PURPLE_SERVER_H_
  26. #define _PURPLE_SERVER_H_
  27.  
  28. #include "account.h"
  29. #include "conversation.h"
  30. #include "prpl.h"
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. /**
  37.  * Send a typing message to a given user over a given connection.
  38.  *
  39.  * TODO: Could probably move this into the conversation API.
  40.  *
  41.  * @param gc    The connection over which to send the typing notification.
  42.  * @param name  The user to send the typing notification to.
  43.  * @param state One of PURPLE_TYPING, PURPLE_TYPED, or PURPLE_NOT_TYPING.
  44.  * @return A quiet-period, specified in seconds, where Purple will not
  45.  *         send any additional typing notification messages.  Most
  46.  *         protocols should return 0, which means that no additional
  47.  *         PURPLE_TYPING messages need to be sent.  If this is 5, for
  48.  *         example, then Purple will wait five seconds, and if the Purple
  49.  *         user is still typing then Purple will send another PURPLE_TYPING
  50.  *         message.
  51.  */
  52. unsigned int serv_send_typing(PurpleConnection *gc, const char *name, PurpleTypingState state);
  53.  
  54. void serv_move_buddy(PurpleBuddy *, PurpleGroup *, PurpleGroup *);
  55. int  serv_send_im(PurpleConnection *, const char *, const char *, PurpleMessageFlags flags);
  56. void serv_get_info(PurpleConnection *, const char *);
  57. void serv_set_info(PurpleConnection *, const char *);
  58.  
  59. void serv_add_permit(PurpleConnection *, const char *);
  60. void serv_add_deny(PurpleConnection *, const char *);
  61. void serv_rem_permit(PurpleConnection *, const char *);
  62. void serv_rem_deny(PurpleConnection *, const char *);
  63. void serv_set_permit_deny(PurpleConnection *);
  64. void serv_chat_invite(PurpleConnection *, int, const char *, const char *);
  65. void serv_chat_leave(PurpleConnection *, int);
  66. void serv_chat_whisper(PurpleConnection *, int, const char *, const char *);
  67. int  serv_chat_send(PurpleConnection *, int, const char *, PurpleMessageFlags flags);
  68. void serv_alias_buddy(PurpleBuddy *);
  69. void serv_got_alias(PurpleConnection *gc, const char *who, const char *alias);
  70.  
  71. /**
  72.  * Receive a typing message from a remote user.  Either PURPLE_TYPING
  73.  * or PURPLE_TYPED.  If the user has stopped typing then use
  74.  * serv_got_typing_stopped instead.
  75.  *
  76.  * TODO: Could probably move this into the conversation API.
  77.  *
  78.  * @param gc      The connection on which the typing message was received.
  79.  * @param name    The name of the remote user.
  80.  * @param timeout If this is a number greater than 0, then
  81.  *        Purple will wait this number of seconds and then
  82.  *        set this buddy to the PURPLE_NOT_TYPING state.  This
  83.  *        is used by protocols that send repeated typing messages
  84.  *        while the user is composing the message.
  85.  * @param state   The typing state received
  86.  */
  87. void serv_got_typing(PurpleConnection *gc, const char *name, int timeout,
  88.                      PurpleTypingState state);
  89.  
  90. /**
  91.  * TODO: Could probably move this into the conversation API.
  92.  */
  93. void serv_got_typing_stopped(PurpleConnection *gc, const char *name);
  94.  
  95. void serv_got_im(PurpleConnection *gc, const char *who, const char *msg,
  96.                  PurpleMessageFlags flags, time_t mtime);
  97.  
  98. /**
  99.  * @param data The hash function should be g_str_hash() and the equal
  100.  *             function should be g_str_equal().
  101.  */
  102. void serv_join_chat(PurpleConnection *, GHashTable *data);
  103.  
  104. /**
  105.  * @param data The hash function should be g_str_hash() and the equal
  106.  *             function should be g_str_equal().
  107.  */
  108. void serv_reject_chat(PurpleConnection *, GHashTable *data);
  109.  
  110. /**
  111.  * Called by a prpl when an account is invited into a chat.
  112.  *
  113.  * @param gc      The connection on which the invite arrived.
  114.  * @param name    The name of the chat you're being invited to.
  115.  * @param who     The username of the person inviting the account.
  116.  * @param message The optional invite message.
  117.  * @param data    The components necessary if you want to call serv_join_chat().
  118.  *                The hash function should be g_str_hash() and the equal
  119.  *                function should be g_str_equal().
  120.  */
  121. void serv_got_chat_invite(PurpleConnection *gc, const char *name,
  122.                           const char *who, const char *message,
  123.                           GHashTable *data);
  124.  
  125. PurpleConversation *serv_got_joined_chat(PurpleConnection *gc,
  126.                                        int id, const char *name);
  127. void serv_got_chat_left(PurpleConnection *g, int id);
  128. void serv_got_chat_in(PurpleConnection *g, int id, const char *who,
  129.                       PurpleMessageFlags flags, const char *message, time_t mtime);
  130. void serv_send_file(PurpleConnection *gc, const char *who, const char *file);
  131.  
  132. #ifdef __cplusplus
  133. }
  134. #endif
  135.  
  136. #endif /* _PURPLE_SERVER_H_ */
  137.